-
Notifications
You must be signed in to change notification settings - Fork 3k
Added cross references between CORS and CSRF guides #51418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
sberyozkin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much @sithmein, LGTM, proposed minor updates only
FroMage
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to point out that there does not appear to be a consensus here, when I search online, and in fact many people point out that CORS is not a substitute for CSRF, and in particular CORS only applies to XHR and not to forms.
See https://stackoverflow.com/questions/19793695/does-a-proper-cors-setup-prevent-csrf-attack but that's not the only place I saw mentioning that.
So, at the very least, we should be much more nuanced in how we present the cases where CORS can help in some cases against some CSRF attacks.
|
The browser respecting CORS headers does indeed not apply to forms. But the server-side checks that are done by the CORS filter do prevent CSRF also for forms. Therefore it's "only" this part of the filter that is relevant for CSRF, setting the headers does not play a role. |
How? |
|
By checking whether |
6d4e92a to
69f88a8
Compare
|
I guess it depends on whether CORS will reject requests when no |
|
CSRF is mostly only an issue in the browser because it automatically sends session cookies with every requests. And the browser always sets the |
This comment has been minimized.
This comment has been minimized.
@sithmein If form submissions are done from scripts, sure CORS filter will handle it, but HTML forms that are just part of simple HTML pages won't have |
|
It's hard to find definite information but as far as I know, the |
Sure. Let me suggest a couple of other minor updates to stress the users have to be certain that |
|
@sithmein Have a look at the proposed updates please, I suppose we indeed should offer a rather strong recommendation for users to check it, to make sure users do not incidentally deploy the CORS filter where no Origin is available for whatever reasons |
This fixes issue quarkusio#51290.
f1279a7 to
a68d147
Compare
Status for workflow
|

Uh oh!
There was an error while loading. Please reload this page.